/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */



$(document).ready(function(){
    $('.form-checkboxes input').bind('click', disableOrg);
    document.getElementById( "edit-field-profile-org-nid-nid-wrapper").setAttribute("style",'display:none');
    document.getElementById( "edit-field-profile-supervisor-uid-uid-wrapper").setAttribute("style",'display:none');
    document.getElementById( "edit-field-graduate-time-0-value-wrapper").setAttribute("style",'display:none');
});

function disableOrg(){
    var seller=document.getElementById( 'edit-roles-5');
    var sponsor=document.getElementById( 'edit-roles-6');
    var agent=document.getElementById( 'edit-roles-3');
    
    if(seller.checked!=true && sponsor.checked!=true){
        document.getElementById( "edit-field-profile-org-nid-nid-wrapper").setAttribute("style",'display:none');
        document.getElementById( "edit-field-graduate-time-0-value-wrapper").setAttribute("style",'display:none');
    }else{
        document.getElementById( "edit-field-profile-org-nid-nid-wrapper").setAttribute("style",'display:display');
        document.getElementById( "edit-field-graduate-time-0-value-wrapper").setAttribute("style",'display:display');
    }
    
    if(agent.checked==true){
        document.getElementById( "edit-field-profile-supervisor-uid-uid-wrapper").setAttribute("style",'display:display');
    }else{
        document.getElementById( "edit-field-profile-supervisor-uid-uid-wrapper").setAttribute("style",'display:none');
    }
} 